Function.prototype.myCall = function(context) {
    if(typeof this !== 'function') {
        throw Error('type error!!!')
    }
    if(!context) {
        context = window
    }
    let result = null
    context.fn = this
    result = context.fn(arguments[1])
    return result
}



let a = {
    n: 1
}, b = {
    n: 2
}

function fn() {
    console.log(this.n)
}

fn.myCall(a)
